package com.cyf.db.mapper.smartCity;

import com.cyf.db.bean.LocalFeeGroup;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface LocalFeeGroupMapper {
    @Select("select * from local_feegroup where parkingId = #{parkingId} and localFeegroupId = #{localFeegroupId}")
    LocalFeeGroup getByParkingIdAndLocalId(@Param("parkingId") Integer parkingId, @Param("localFeegroupId") Integer localFeegroupId);

    @Select("select name from local_feegroup where parkingId = #{parkingId} and localFeegroupId = #{localFeegroupId}")
    String getNameByParkingIdAndLocalId(@Param("parkingId") Integer parkingId, @Param("localFeegroupId") Integer localFeegroupId);

    @Select("select * from local_feegroup " +
            "where status = 1 and parkingId = #{parkingId} and wechatShow = 1 ")
    List<LocalFeeGroup> listShowByParkingId(@Param("parkingId") Integer parkingId);

    @Select("select id, name, localFeegroupId,fee from local_feegroup " +
            "where status = 1 and parkingId = #{parkingId} and wechatShow = 1 " +
            "and (billingType = 1 or billingType = 7)")
    List<LocalFeeGroup> getWechatShowFeeRateByParkingIdAndType(@Param("parkingId") Integer parkingId);





}
